//引入代码
var call = require('../../util/request.js');
var qrCode = require('../../util/weapp-qrcode.js');
Page({
  data: {
    
  },
  onLoad: function(options) {
	  console.log('订单测试'+6455)
	  //订单详细
	  call.getData('api/orderDetail?order_id=' + options.order_no, this.orderDetail, this.fail);
	  
						
  },
  orderDetail:function(data){
	  this.setData({
	  	orders: data.data
	  })
	  
	  // 二维码生成工具
	  new qrCode('couponQrcode', {
	  	text: data.data.order_no,
	  	width: 200,
	  	height: 200,
	  	colorDark: "#333333",
	  	colorLight: "#FFFFFF",
	  	correctLevel: qrCode.CorrectLevel.H
	  })
	  
	 
  },
  purchase:function(){
	  //继续购买
	  console.log('点击')
	  tt.switchTab({ url: '/pages/index/index' })
  },
  order_details:function(e){
	   console.log('事件'+e.currentTarget.dataset.ids)
	  tt.navigateTo({ url: '/pages/order_details/order_details?id='+e.currentTarget.dataset.ids, })
  },
  onReady: function() {
	
  },
 
  onShow: function() {
		
  },
  onHide: function() {

  },
  onUnload: function() {

  },
})